package woaini.fenger.core.bot.utils;

import lombok.experimental.UtilityClass;

import javax.swing.plaf.PanelUI;

/**
 * 终点工具
 * @see  woaini.fenger.core.bot.utils.EndPointTool
 * @author yefeng
 * {@code @Date} 2023-05-16 16:50:39
 */
@UtilityClass
public class EndPointTool {

    public String convertHttpEndPoint(String endPoint,Boolean ssl) {
        String replaceStr = "http://";
        if (ssl){
            replaceStr = "https://";
        }
        endPoint = endPoint.replaceAll("\\S+://",replaceStr);

        int index = endPoint.indexOf("/",8);
        if (index > 8){
            endPoint = endPoint.substring(0,index);
        }
        return endPoint;
    }
}
